Skip to content

Add copy column data feature with multi-selector dialog - #22

Merged
clobrano merged 1 commit into
mainfrom
claude/affectionate-tesla-1Fktl
May 29, 2026
Merged

Add copy column data feature with multi-selector dialog#22
clobrano merged 1 commit into
mainfrom
claude/affectionate-tesla-1Fktl

Conversation

@clobrano

Copy link
Copy Markdown
Owner

Summary

This PR adds a new "copy column data" feature that allows users to select and copy individual or combined column values from table rows to the clipboard.

Key Changes

  • New MultiSelectorModel component (internal/tui/components/dialog/multiselector.go): A reusable floating dialog that allows toggling multiple items with spacebar and confirming selection with enter. Supports keyboard navigation (j/k or arrow keys) and displays checkboxes for selected items.

  • Copy data dialog integration (internal/tui/app.go):

    • Added ViewCopy state to handle the copy dialog overlay
    • Implemented openCopySelector() to build column options from the current table row
    • Added special "NAME+NS" combined option that formats as <name> --namespace <namespace> for convenience
    • Implemented copyToClipboard() command that tries multiple clipboard tools (xclip, xsel, pbcopy) for cross-platform support
  • Keybinding updates (internal/tui/keys.go, internal/config/config.go, internal/config/defaults.go):

    • Added new CopyData keybinding (default: c)
    • Changed SwitchContext keybinding from c to C to avoid conflict
    • Updated help text to display the new copy command

Implementation Details

  • The multi-selector dialog displays column headers with their values in a compact format (%-12s %s)
  • Supports scrolling through items when there are more than 10 visible items
  • If no items are explicitly selected, pressing enter selects the currently highlighted item
  • Clipboard operations are non-blocking and gracefully fail if no clipboard tool is available
  • The dialog is rendered as a full-screen overlay centered on the terminal

https://claude.ai/code/session_01XXnSRgHebTqJjoinv3Yz7k

Press 'c' in any tab view to open a floating multi-select dialog showing
each column of the current row as a toggle option. Space toggles items,
Enter confirms and copies the joined values to the system clipboard.
A special combined "NAME --namespace NAMESPACE" option is shown when
both columns are present.

SwitchContext is reassigned from 'c' to 'C' to free the key.
@clobrano
clobrano merged commit 20744b2 into main May 29, 2026
2 of 3 checks passed
@clobrano
clobrano deleted the claude/affectionate-tesla-1Fktl branch May 29, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants